package com.xbq.exceleditor.ui.filechooser.media;

import android.net.Uri;
import android.os.Parcel;
import android.os.Parcelable;

import androidx.annotation.Keep;

import java.io.Serializable;

/**
 * Author: liaohaiping
 * Time: 2019-03-08
 * Description:
 */
@Keep
public class ContentResolveFile implements Parcelable {
    private String fileName;
    private String filePath;
    private Uri uri;
    private long fileSize;
    private long fileTime;
    private String fileExtension;


    public ContentResolveFile() {
    }


    public ContentResolveFile(Parcel in) {
        fileName = in.readString();
        filePath = in.readString();
        uri = in.readParcelable(Uri.class.getClassLoader());
        fileSize = in.readLong();
        fileTime = in.readLong();
        fileExtension = in.readString();
    }

    public String getFileName() {
        return fileName;
    }

    public ContentResolveFile setFileName(String fileName) {
        this.fileName = fileName;
        return this;
    }

    public String getFilePath() {
        return filePath;
    }

    public ContentResolveFile setFilePath(String filePath) {
        this.filePath = filePath;
        return this;
    }

    public Uri getUri() {
        return uri;
    }

    public ContentResolveFile setUri(Uri uri) {
        this.uri = uri;
        return this;
    }

    public long getFileSize() {
        return fileSize;
    }

    public ContentResolveFile setFileSize(long fileSize) {
        this.fileSize = fileSize;
        return this;
    }

    public long getFileTime() {
        return fileTime;
    }

    public ContentResolveFile setFileTime(long fileTime) {
        this.fileTime = fileTime;
        return this;
    }

    public String getFileExtension() {
        return fileExtension;
    }

    public ContentResolveFile setFileExtension(String fileExtension) {
        this.fileExtension = fileExtension;
        return this;
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(fileName);
        dest.writeString(filePath);
        dest.writeParcelable(uri, flags);
        dest.writeLong(fileSize);
        dest.writeLong(fileTime);
        dest.writeString(fileExtension);
    }


    public static final Creator<ContentResolveFile> CREATOR = new Creator<ContentResolveFile>() {
        @Override
        public ContentResolveFile createFromParcel(Parcel in) {
            return new ContentResolveFile(in);
        }

        @Override
        public ContentResolveFile[] newArray(int size) {
            return new ContentResolveFile[size];
        }
    };
}
